_onNotificationAdded: function(source, notification) {
let message = new NotificationMessage(notification);
- let time = Util.formatTime(new Date());
- message.setSecondaryActor(new St.Label({ style_class: 'event-time',
- x_align: Clutter.ActorAlign.END,
- text: time }));
+ let timeLabel = Util.createTimeLabel(new Date());
+ timeLabel.style_class = 'event-time',
+ timeLabel.x_align = Clutter.ActorAlign.END;
+ message.setSecondaryActor(timeLabel);
let isUrgent = notification.urgency == MessageTray.Urgency.CRITICAL;
if (isUrgent) {
let lastMessageTime = this._history[0].time;
let lastMessageDate = new Date(lastMessageTime * 1000);
- let timeLabel = new St.Label({ text: Util.formatTime(lastMessageDate),
- style_class: 'chat-meta-message',
- x_expand: true,
- y_expand: true,
- x_align: Clutter.ActorAlign.END,
- y_align: Clutter.ActorAlign.END });
+ let timeLabel = Util.createTimeLabel(lastMessageDate);
+ timeLabel.style_class = 'chat-meta-message';
+ timeLabel.x_expand = timeLabel.y_expand = true;
+ timeLabel.x_align = timeLabel.y_align = Clutter.ActorAlign.END;
this._lastMessageBox.add_actor(timeLabel);